var util = require('../../../utils/util.js');
var apiObject = require('../../../utils/api.js');
var app = getApp();

Page({

  data: {
    imageHost: apiObject.imageHost,
    showLoginOut:true,
    user: { headUrl:"head.png"}
  },

  onShow: function (e) {
    var that = this;
    util.request(apiObject.api.getUserInfo).then(function (res) {
      console.log(res)
      if (res.code == 200) {
        that.setData({
          user:res.result.user
        })
      } else {
        util.showModal(res.message);
      }
    })

   
  },
  loginOut:function(){
    wx.removeStorageSync("token");
    wx.redirectTo({
      url: '../../login/index',
    })
  },
  redirectUserInfo:function(){
   
  },
  redirectAddress: function () {
  
  }

})